Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the pull request
Corrects a few math issues and loosens tolerances so vehicle-crash-interior-flinging can actually happen now.
move_momentum
can be positive for forward or negative for backward, soFloor(move_momentum/2)
made forward crashes less intense and backward crashes more intense. Corrected totrunc(move_momentum/2)
, which rounds towards zero consistently.The maximum value for
move_momentum
, fittingly namedmove_max_momentum
, is 2 for the APC and 3 for the tank. Because its divided by 2 and then floored, the max momentum actually fed to theinterior_crash_effect()
proc was 1* (3/2 = 1.5, floor(1.5) = 1).interior_crash_effect()
has an early return forif(abs(move_momentum) <= 1)
. Corrected toif(abs(move_momentum) < 1)
so values of 1 still trigger the crash.*except the tank moving backwards, (-3/2 = -1.5, floor(-1.5) = -2)
Correctly uses the magnitude of
move_momentum
in places where a negative number would cause inconsistent results, likefling_distance
and camera shake strength.Explain why it's good for the game
The code was there, implemented, called, but never actually fulfilled its own conditions -- except for the tank driving backwards at full speed, which can't be the only intended use.
If crashing wasn't desired, it would be better to remove it completely rather than leaving it in its bugged state.
Testing Photographs and Procedure
Boots without issue. Crashing visual and fling effects now work for both forward and backward collisions.
Changelog
🆑
fix: vehicle crashes more consistently fling loose contents
/:cl: